//
//  SuggestionBackViewController.m
//  Socrates
//
//  Created by shy on 15/4/14.
//  Copyright (c) 2015年 shy. All rights reserved.
//

#import "SuggestionBackViewController.h"

#import "RDVTabBarController.h"

@interface SuggestionBackViewController() {
    UITextView *suggestion_;
}
@property (strong, nonatomic) UIBarButtonItem *homeRightBarBtn;

@end

@implementation SuggestionBackViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor colorWithRed:239/255. green:239/255. blue:244/255. alpha:1.];
    self.navigationItem.title = @"发表建议";
    self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]};
    CGSize frame = [UIScreen mainScreen].bounds.size;
    suggestion_ = [[UITextView alloc] initWithFrame:CGRectMake(15, 0, frame.width - 30, frame.height/3)];
    suggestion_.text = @"你对我们的建议是：";
    suggestion_.textColor = [UIColor grayColor];
    suggestion_.font = [UIFont systemFontOfSize:15.];
    suggestion_.backgroundColor = [UIColor colorWithRed:239/255. green:239/255. blue:244/255. alpha:1.];
    [self.view addSubview:suggestion_];
    self.navigationItem.rightBarButtonItem = [self makeBarBtn];;
}

- (UIBarButtonItem *)makeBarBtn {
    UIButton *settings = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 20)];
    [settings setTitle:@"发表" forState:UIControlStateNormal];
    [settings addTarget:self action:@selector(clickRightBarButton:) forControlEvents:UIControlEventTouchUpInside];
    self.homeRightBarBtn = [[UIBarButtonItem alloc] initWithCustomView:settings];
    
    return self.homeRightBarBtn;
}

- (void)clickRightBarButton:(id)sender {
    
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    [[self rdv_tabBarController] setTabBarHidden:YES animated:NO];
}

- (void)viewWillDisappear:(BOOL)animated {
//    [[self rdv_tabBarController] setTabBarHidden:NO animated:NO];
    
    [super viewWillDisappear:animated];
}

@end
